home *** CD-ROM | disk | FTP | other *** search
/ TOS Silver 2000 / TOS Silver 2000.iso / Anwendun / LUNA152A / MODULE / DEVELOPE.TXT < prev    next >
Encoding:
Text File  |  1999-11-08  |  2.7 KB  |  57 lines

  1.      
  2.  Module specification for simple filter modules for Luna.
  3.  --------------------------------------------------------
  4.  
  5.  - A Luna filter module uses the file extension 'FM' or 'fm'.
  6.  - The module is loaded and accessed directly by Luna (straight to the 
  7.    text segment, without pexec() modes or relocation).
  8.  - Paramater passing is via the stack.
  9.  - The module is a normal program file with a 28 byte-long header.
  10.  
  11.  Return parameters in D0, registers d0-d7 and a0-a2 may be altered. While 
  12.  handling the block the filter module remains in memory and is called 
  13.  once before filtering starts for initialisation, then for each line of 
  14.  the block to be filtered, and finally once after filtering for de- 
  15.  initialisation.
  16.  
  17.  If such a module wishes to alter the line length (e.g. by substituting 
  18.  a character string by another one), then the Luna working buffer should 
  19.  be used, whose address is also passed.
  20.  
  21.  A possibly altered character string (null-terminated) is read by Luna 
  22.  from the working buffer and then,corresponding to the block markings, 
  23.  the line in the marked text is altered.
  24.  To inform Luna that an altered character string is present in the 
  25.  working buffer a 1 should be returned after filtering, otherwise 0.
  26.  
  27.  
  28.  ------------------------------------------------------------------------------
  29.   Luna always calls the module with the following basic parameters:
  30.  ------------------------------------------------------------------------------
  31. a:  4(sp) word   Function number.
  32. b:  6(sp) long   Address of the string to be handled.
  33. c:  10(sp) long   Address of the working buffer.
  34. d:  14(sp) word   Length of string to be handled.
  35. e:  16(sp) word   Length of the working buffer (this is always 
  36.                    the maximum line length present in the text*4.
  37.  
  38.  The values 'b' and 'd' are only valid for function number 0.
  39.  
  40.  ------------------------------------------------------------------------------
  41.   The function numbers available to date:
  42.  ------------------------------------------------------------------------------
  43.   0 = Execute filter function.
  44.   1 = Return a pointer to the info-text (see below).
  45.       A pointer to the info-text is to be returned in D0.
  46.   2 = Initialisation of the module.
  47.       Return is to be Null (OK), or an error code.
  48.     3 = Deinitialisation of the module.
  49.       Return is to be Null (OK), or an error code.
  50.  ------------------------------------------------------------------------------
  51.   Exit codes to date (long):
  52.  ------------------------------------------------------------------------------
  53.      0 : OK.
  54.      1 : New string in working buffer (Null-terminated).
  55.    -32 : Invalid function number.
  56.     <0 : TOS error-messages.
  57.